package pers.zc.activiti.shejimoshi.guanchazhe.guanchazhe;

import java.util.ArrayList;
import java.util.List;


/**
 * @Annotion:  观察者方法
 * @ClassName: Subject
 * @Author: Lin Fuyuan
 * @Date: 2019/9/24  10:14
 * @Version: 1.0
 */
public abstract class Subject {
    protected List<Observer> observers = new ArrayList<>();
    /*增加观察者方法*/
    public void add(Observer observer){
        observers.add(observer);
    }
    /*删除观察者方法*/
    public void remove(Observer observer){
        observers.remove(observer);
    }
    /*通知观察者抽象方法*/
    public abstract void notifyObserver();

}
